@echo off
title Tender-REST-Server

if "%JAVA_HOME%"=="" (echo "Setting JAVA_HOME") else (goto COMMAND-LINE);
set JAVA_HOME=D:\tools\java\jdk1.8.0_171
set PATH=.;%JAVA_HOME%/bin;%JAVA_HOME%/jre/bin;%PATH%
set CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
goto COMMAND-LINE

:COMMAND-LINE
rem 获取当前路径下 jar 文件名
for /f "delims=" %%A in ('dir /b %~dp0*.jar') do set "filename=%%A"
echo 执行jar文件名: %filename%
java -version
pause

java -classpath ./lib/*.jar -jar -Xms1024m -Xmx2048m ./%filename% --spring.profiles.active=prod